<h4>All Notes for <%= @resource.title %></h4>
<% for note in @notes %>
	<% @note = note %>
	<p>
	<%= render :partial => 'generalTemplates/see_others_visible_notes'  %> 
		<div id="note_<%= @note.id.to_s %>"> 
		<%= render :partial => 'notes/note_graded'  %>   	
		
	
	<% if ((Note.getVoteThisNote(session[:user_id],note.id) == 0) and (note.user.id != session[:user_id])) then %>
		<%= link_to_remote image_tag("icon_thumb_up.gif", :title => "good"),
			:url => {:controller=>"notes", 
					:action=>"grade_with", 
					:val=>1,
					:id=>note.id},
					:update =>  "note_" + @note.id.to_s  %>
		<%= link_to_remote image_tag("icon_thumb_down.gif", :title => "bad"),
			:url => {:controller=>"notes", 
					:action=>"grade_with", 
					:val=>-1,
					:id=>note.id},
					:update =>  "note_" + @note.id.to_s %>
	<% end %>
	</div> 
	by: <%= link_to note.user.username , :action => 'show' , :controller => 'users' , :id => note.user.id %>
	<% if(note.user_id == session[:user_id]) then %> 
	<%= link_to 'Delete', :controller => 'notes' , :action => 'destroy' , :id => note.id %>
	<%= link_to_remote 'Edit', :url => { :controller => 'notes' , :action => 'edit' , :id => note.id},
	:update => "view_note" %>

	 <% end %> 
	</p>
	
 <% end %>
<%= link_to 'back' , :action => 'show' , :controller => 'resources' , :id => @resource.id %>